import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../layout/Layout'
Vue.use(VueRouter)

const constRouters = [
  {
    path: '/',
    component: Layout,
    name: '首页',
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: () => import('@/views/HomePage')
      },
    ]
  },
  {
    name: '项目管理',
    path: '/management',
    component: Layout,
    redirect: '/management/index',
    children: [
      {
        path: 'index',
        name: '项目管理',
        component: () => import('@/views/HomePage')
      },
    ]
  },
  {
    path: '/about',
    name: '关于我们',
    redirect: '/about/index',
    component: Layout,
    children: [
      {
        path: 'index',
        name: '成果展示',
        component: () => import('@/views/HomePage')
      },
      {
        path: 'index#group',
        name: '成员介绍',
        component: () => import('@/views/HomePage')
      }
    ]
  },
  {
    path: '/news',
    name: '最新动态',
    redirect: '/news/index',
    component: Layout,
    children: [
      {
        name: '最新动态',
        path: 'index',
        component: () => import('@/views/HomePage')
      }
    ]
  },
  {
    path: '/recruit',
    name: '招纳贤士',
    redirect: '/recruit/index',
    component: Layout,
    children: [
      {
        name: '招纳贤士',
        path: 'index',
        component: () => import('@/views/HomePage')
      }
    ]
  },
  {
    path: '/resource',
    name: '资料分享',
    redirect: '/resource/index',
    component: Layout,
    children: [
      {
        path: 'index',
        component: () => import('@/views/HomePage')
      }
    ]
}]

const router = new VueRouter({
  mode:'history',
  routes: constRouters
})

export default router
